package com.zzq.mapper;


import com.zzq.pojo.Message;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MessageMapper {

    @Select("select * from message")
    List<Message> getMessageList();


    @Delete("delete from message where id=#{id}")
    void deleteMessage(int id);

    @Insert("insert into message (sender_name,message_content,create_at) values (#{senderName},#{messageContent},now())")
    void addMessage(Message message);
}
